;--------------------------------------
;
; saveScrn.asm
;
; saveScrn(int *buffer)
;
; int *buffer points to 2000 Word buffer
;
; saves the screen to buffer
;
;--------------------------------------
;
; include defs, prototypes and macros
;

include tab6.inc

;--------------------------------------
;
; begin code segment
;
    .Code

saveScrn PROC Pascal PUBLIC USES es di ds si, buffer:PWord
    
; ds:si points to source string
; ds gets screen segment

IF mdl eq 3
    mov    ax,SEG scrn_seg
    mov    ds,ax
    mov    ax,ds:scrn_seg
    mov    ds,ax
    sub    si,si
    les    di,buffer
ELSE
    push   ds
    pop    es
    mov    ax,scrn_seg
    mov    ds,ax
    sub    si,si
    mov    di,buffer
ENDIF

; relocate 2000 screen token to buffer

    cld
    mov    cx,2000
    rep    movsw
    ret

saveScrn   ENDP

    END

;
;--------------------------------------
    
    

